<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>店铺评价</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        }
        .star-rating {
            display: inline-flex;
        }
        .star {
            color: #d1d5db;
            cursor: pointer;
            transition: color 0.2s;
        }
        .star.filled {
            color: #fbbf24;
        }
        .star:hover {
            color: #fbbf24;
        }
    </style>
</head>
<body class="bg-gray-100">
    <div class="mx-auto max-w-[393px] h-[852px] bg-white relative overflow-hidden rounded-[40px] shadow-2xl">
        <!-- Status Bar -->
        <div class="bg-white px-6 pt-3 pb-2">
            <div class="flex justify-between items-center text-xs">
                <span class="font-semibold">9:41</span>
                <div class="flex space-x-1">
                    <i class="fas fa-signal"></i>
                    <i class="fas fa-wifi"></i>
                    <i class="fas fa-battery-full"></i>
                </div>
            </div>
        </div>

        <!-- Header -->
        <div class="bg-gradient-to-r from-purple-500 to-pink-500 px-4 py-3">
            <div class="flex items-center justify-between text-white">
                <a href="notifications.html" class="text-white">
                    <i class="fas fa-arrow-left text-lg"></i>
                </a>
                <h1 class="text-lg font-semibold">店铺评价</h1>
                <button onclick="exportReviews()" class="text-white">
                    <i class="fas fa-download text-lg"></i>
                </button>
            </div>
        </div>

        <!-- Rating Overview -->
        <div class="px-4 py-3 bg-gradient-to-r from-purple-500 to-pink-500">
            <div class="bg-white/10 backdrop-blur-sm rounded-xl p-4">
                <div class="flex items-center text-white">
                    <div class="text-center mr-6">
                        <p class="text-3xl font-bold">4.9</p>
                        <div class="flex justify-center mt-1 mb-2">
                            <i class="fas fa-star text-yellow-300 text-sm"></i>
                            <i class="fas fa-star text-yellow-300 text-sm"></i>
                            <i class="fas fa-star text-yellow-300 text-sm"></i>
                            <i class="fas fa-star text-yellow-300 text-sm"></i>
                            <i class="fas fa-star text-yellow-300 text-sm"></i>
                        </div>
                        <p class="text-xs opacity-80">综合评分</p>
                    </div>
                    <div class="flex-1 space-y-2">
                        <div class="flex items-center">
                            <span class="text-sm mr-2">5星</span>
                            <div class="flex-1 bg-white/20 rounded-full h-2">
                                <div class="bg-yellow-400 h-2 rounded-full" style="width: 85%"></div>
                            </div>
                            <span class="text-sm ml-2">85%</span>
                        </div>
                        <div class="flex items-center">
                            <span class="text-sm mr-2">4星</span>
                            <div class="flex-1 bg-white/20 rounded-full h-2">
                                <div class="bg-yellow-400 h-2 rounded-full" style="width: 12%"></div>
                            </div>
                            <span class="text-sm ml-2">12%</span>
                        </div>
                        <div class="flex items-center">
                            <span class="text-sm mr-2">3星</span>
                            <div class="flex-1 bg-white/20 rounded-full h-2">
                                <div class="bg-yellow-400 h-2 rounded-full" style="width: 2%"></div>
                            </div>
                            <span class="text-sm ml-2">2%</span>
                        </div>
                    </div>
                </div>
                <div class="grid grid-cols-3 gap-3 mt-4 pt-4 border-t border-white/20 text-center">
                    <div>
                        <p class="text-lg font-bold">1,268</p>
                        <p class="text-xs opacity-80">总评价</p>
                    </div>
                    <div>
                        <p class="text-lg font-bold">98.5%</p>
                        <p class="text-xs opacity-80">好评率</p>
                    </div>
                    <div>
                        <p class="text-lg font-bold">24</p>
                        <p class="text-xs opacity-80">新增评价</p>
                    </div>
                </div>
            </div>
        </div>

        <!-- Filter Tabs -->
        <div class="px-4 py-2 bg-white border-b border-gray-200">
            <div class="flex space-x-2 overflow-x-auto">
                <button onclick="filterReviews('all')" id="filter-all" class="bg-purple-500 text-white text-xs px-3 py-2 rounded-lg whitespace-nowrap">
                    全部评价(1268)
                </button>
                <button onclick="filterReviews('good')" id="filter-good" class="bg-gray-100 text-gray-600 text-xs px-3 py-2 rounded-lg whitespace-nowrap">
                    好评(1249)
                </button>
                <button onclick="filterReviews('medium')" id="filter-medium" class="bg-gray-100 text-gray-600 text-xs px-3 py-2 rounded-lg whitespace-nowrap">
                    中评(15)
                </button>
                <button onclick="filterReviews('bad')" id="filter-bad" class="bg-gray-100 text-gray-600 text-xs px-3 py-2 rounded-lg whitespace-nowrap">
                    差评(4)
                </button>
                <button onclick="filterReviews('images')" id="filter-images" class="bg-gray-100 text-gray-600 text-xs px-3 py-2 rounded-lg whitespace-nowrap">
                    有图评价
                </button>
            </div>
        </div>

        <!-- Reviews List -->
        <div class="h-[calc(852px-320px)] overflow-y-auto pb-24">
            <div class="p-4">
                <!-- Excellent Review -->
                <div class="bg-white rounded-lg border border-gray-200 p-4 mb-3 shadow-sm">
                    <div class="flex items-start mb-3">
                        <img src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=40&h=40&fit=crop&crop=face" 
                             alt="用户头像" class="w-10 h-10 rounded-full mr-3">
                        <div class="flex-1">
                            <div class="flex items-center justify-between mb-2">
                                <div class="flex items-center">
                                    <span class="font-medium text-sm mr-2">张**</span>
                                    <div class="flex">
                                        <i class="fas fa-star text-yellow-400 text-xs"></i>
                                        <i class="fas fa-star text-yellow-400 text-xs"></i>
                                        <i class="fas fa-star text-yellow-400 text-xs"></i>
                                        <i class="fas fa-star text-yellow-400 text-xs"></i>
                                        <i class="fas fa-star text-yellow-400 text-xs"></i>
                                    </div>
                                </div>
                                <span class="text-xs text-gray-400">2天前</span>
                            </div>
                            <p class="text-sm text-gray-700 mb-2">商品质量很好，包装也很精美，发货速度快，客服态度很好，非常满意的一次购物体验！</p>
                            <div class="flex items-center text-xs text-gray-500 mb-2">
                                <span class="mr-4">商品: 无线蓝牙耳机</span>
                                <span>规格: 黑色/标准版</span>
                            </div>
                            <!-- Review Images -->
                            <div class="flex space-x-2 mb-3">
                                <img src="https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=60&h=60&fit=crop" 
                                     alt="评价图片" class="w-15 h-15 rounded-lg object-cover cursor-pointer" onclick="viewImage(this.src)">
                                <img src="https://images.unsplash.com/photo-1542291026-7eec264c27ff?w=60&h=60&fit=crop" 
                                     alt="评价图片" class="w-15 h-15 rounded-lg object-cover cursor-pointer" onclick="viewImage(this.src)">
                            </div>
                            <div class="flex justify-between items-center">
                                <div class="flex items-center text-xs text-gray-500">
                                    <i class="fas fa-thumbs-up mr-1"></i>
                                    <span class="mr-3">12</span>
                                    <i class="fas fa-comment mr-1"></i>
                                    <span>3</span>
                                </div>
                                <button onclick="replyReview('r001')" class="text-purple-600 text-xs">回复</button>
                            </div>
                            
                            <!-- Merchant Reply -->
                            <div class="mt-3 bg-purple-50 rounded-lg p-3">
                                <div class="flex items-start">
                                    <div class="w-6 h-6 bg-purple-500 rounded-full flex items-center justify-center mr-2 flex-shrink-0">
                                        <i class="fas fa-store text-white text-xs"></i>
                                    </div>
                                    <div class="flex-1">
                                        <p class="text-xs text-purple-600 font-medium mb-1">商家回复:</p>
                                        <p class="text-xs text-gray-600">感谢您的好评！我们会继续提供优质的商品和服务！</p>
                                    </div>
                                    <span class="text-xs text-gray-400">1天前</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Good Review -->
                <div class="bg-white rounded-lg border border-gray-200 p-4 mb-3 shadow-sm">
                    <div class="flex items-start mb-3">
                        <img src="https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=40&h=40&fit=crop&crop=face" 
                             alt="用户头像" class="w-10 h-10 rounded-full mr-3">
                        <div class="flex-1">
                            <div class="flex items-center justify-between mb-2">
                                <div class="flex items-center">
                                    <span class="font-medium text-sm mr-2">李**</span>
                                    <div class="flex">
                                        <i class="fas fa-star text-yellow-400 text-xs"></i>
                                        <i class="fas fa-star text-yellow-400 text-xs"></i>
                                        <i class="fas fa-star text-yellow-400 text-xs"></i>
                                        <i class="fas fa-star text-yellow-400 text-xs"></i>
                                        <i class="fas fa-star text-yellow-400 text-xs"></i>
                                    </div>
                                </div>
                                <span class="text-xs text-gray-400">3天前</span>
                            </div>
                            <p class="text-sm text-gray-700 mb-2">物流很快，包装完好，商品和描述一致，性价比不错，推荐购买！</p>
                            <div class="flex items-center text-xs text-gray-500 mb-2">
                                <span class="mr-4">商品: 便携充电宝</span>
                                <span>规格: 白色/20000mAh</span>
                            </div>
                            <div class="flex justify-between items-center">
                                <div class="flex items-center text-xs text-gray-500">
                                    <i class="fas fa-thumbs-up mr-1"></i>
                                    <span class="mr-3">8</span>
                                    <i class="fas fa-comment mr-1"></i>
                                    <span>1</span>
                                </div>
                                <button onclick="replyReview('r002')" class="text-purple-600 text-xs">回复</button>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Medium Review -->
                <div class="bg-white rounded-lg border border-gray-200 p-4 mb-3 shadow-sm">
                    <div class="flex items-start mb-3">
                        <img src="https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=40&h=40&fit=crop&crop=face" 
                             alt="用户头像" class="w-10 h-10 rounded-full mr-3">
                        <div class="flex-1">
                            <div class="flex items-center justify-between mb-2">
                                <div class="flex items-center">
                                    <span class="font-medium text-sm mr-2">王**</span>
                                    <div class="flex">
                                        <i class="fas fa-star text-yellow-400 text-xs"></i>
                                        <i class="fas fa-star text-yellow-400 text-xs"></i>
                                        <i class="fas fa-star text-yellow-400 text-xs"></i>
                                        <i class="fas fa-star text-gray-300 text-xs"></i>
                                        <i class="fas fa-star text-gray-300 text-xs"></i>
                                    </div>
                                </div>
                                <span class="text-xs text-gray-400">5天前</span>
                            </div>
                            <p class="text-sm text-gray-700 mb-2">商品还行，但是包装有点简陋，希望能改进一下。发货速度可以。</p>
                            <div class="flex items-center text-xs text-gray-500 mb-2">
                                <span class="mr-4">商品: 无线键盘鼠标套装</span>
                                <span>规格: 黑色/标准版</span>
                            </div>
                            <div class="flex justify-between items-center">
                                <div class="flex items-center text-xs text-gray-500">
                                    <i class="fas fa-thumbs-up mr-1"></i>
                                    <span class="mr-3">2</span>
                                    <i class="fas fa-comment mr-1"></i>
                                    <span>5</span>
                                </div>
                                <button onclick="replyReview('r003')" class="text-purple-600 text-xs">回复</button>
                            </div>

                            <!-- Merchant Reply -->
                            <div class="mt-3 bg-purple-50 rounded-lg p-3">
                                <div class="flex items-start">
                                    <div class="w-6 h-6 bg-purple-500 rounded-full flex items-center justify-center mr-2 flex-shrink-0">
                                        <i class="fas fa-store text-white text-xs"></i>
                                    </div>
                                    <div class="flex-1">
                                        <p class="text-xs text-purple-600 font-medium mb-1">商家回复:</p>
                                        <p class="text-xs text-gray-600">感谢您的建议，我们已经升级了包装，后续会有更好的体验！</p>
                                    </div>
                                    <span class="text-xs text-gray-400">4天前</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- New Review Alert -->
                <div class="bg-blue-50 border border-blue-200 rounded-lg p-4 mb-3">
                    <div class="flex items-center">
                        <div class="w-10 h-10 bg-blue-500 rounded-full flex items-center justify-center mr-3">
                            <i class="fas fa-bell text-white"></i>
                        </div>
                        <div class="flex-1">
                            <p class="text-sm font-medium text-blue-800">您有3条新评价待回复</p>
                            <p class="text-xs text-blue-600">及时回复评价可以提高店铺信誉度</p>
                        </div>
                        <button onclick="viewPendingReviews()" class="bg-blue-500 text-white text-xs px-3 py-2 rounded-lg">
                            去处理
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        // Filter reviews by category
        function filterReviews(category) {
            // Remove active styles from all filter buttons
            document.querySelectorAll('[id^="filter-"]').forEach(btn => {
                btn.classList.remove('bg-purple-500', 'text-white');
                btn.classList.add('bg-gray-100', 'text-gray-600');
            });
            
            // Add active styles to selected button
            document.getElementById('filter-' + category).classList.remove('bg-gray-100', 'text-gray-600');
            document.getElementById('filter-' + category).classList.add('bg-purple-500', 'text-white');
            
            // In a real app, this would filter the reviews list
            showToast('筛选：' + getFilterName(category));
        }

        function getFilterName(category) {
            const names = {
                'all': '全部评价',
                'good': '好评',
                'medium': '中评',
                'bad': '差评',
                'images': '有图评价'
            };
            return names[category] || '全部评价';
        }

        // Reply to review
        function replyReview(reviewId) {
            const reply = prompt('回复评价:', '感谢您的评价和建议，我们会继续努力提供更好的商品和服务！');
            if (reply && reply.trim()) {
                alert(`回复已发送\n评价ID: ${reviewId}\n回复内容: ${reply}`);
                showToast('回复已发送');
            }
        }

        // View image
        function viewImage(imageSrc) {
            // Create modal to display image
            const modal = document.createElement('div');
            modal.className = 'fixed inset-0 bg-black bg-opacity-75 flex items-center justify-center z-50';
            modal.onclick = function() {
                document.body.removeChild(modal);
            };
            
            const img = document.createElement('img');
            img.src = imageSrc;
            img.className = 'max-w-full max-h-full';
            
            modal.appendChild(img);
            document.body.appendChild(modal);
        }

        // Export reviews data
        function exportReviews() {
            const formats = ['Excel表格', 'PDF报告', 'CSV数据'];
            const formatIndex = prompt('选择导出格式：\n1. Excel表格\n2. PDF报告\n3. CSV数据\n\n请输入序号(1-3):');
            
            if (formatIndex && formatIndex >= 1 && formatIndex <= 3) {
                const selectedFormat = formats[formatIndex - 1];
                alert(`正在导出评价数据\n格式: ${selectedFormat}\n\n导出完成后将发送到您的邮箱`);
                showToast('导出请求已提交');
            }
        }

        // View pending reviews
        function viewPendingReviews() {
            alert('待处理评价列表\n\n• 新评价 3条\n• 追评 1条\n• 投诉处理 0条\n\n请及时回复以维护店铺形象');
        }

        // Show toast message
        function showToast(message) {
            const toast = document.createElement('div');
            toast.className = 'fixed top-20 left-1/2 transform -translate-x-1/2 bg-gray-800 text-white px-4 py-2 rounded-lg text-sm z-50';
            toast.textContent = message;
            document.body.appendChild(toast);
            
            setTimeout(() => {
                toast.remove();
            }, 2000);
        }

        // Initialize page
        document.addEventListener('DOMContentLoaded', function() {
            filterReviews('all');
        });
    </script>
</body>
</html>